package com.boot2.core.dict;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zhangweilin
 * @description:错误代码,如果各业务系统有各自的错误代码，继承此即可
 * @date 2018/6/9
 */
public class ErrorCode {
    public static final Map<String,String> errorMap = new HashMap<>();
    public static final String codeKey = "code";
    public static final String errorMessageKey = "errorMessage";
    public static final String code_200 = "200";
//    public static final String code_1 = "1";
    public static final String code_301 = "301";
    public static final String code_400 = "400";
    public static final String code_401 = "401";
    public static final String code_403 = "403";
    public static final String code_404 = "404";
    public static final String code_460= "460";
    public static final String code_500 = "500";
    public static final String code_600 = "600";
    static {
        errorMap.put(code_200, "成功");
//        errorMap.put(code_1, "登录成功，但是未绑定");
        errorMap.put(code_301, "客户端重定向，结果中会带一个重定向的url,格式为httpMethod:url,如post:/update/233");
        errorMap.put(code_400, "参数错误");
        errorMap.put(code_401, "未认证，未登录");
        errorMap.put(code_403, "已登录，但是无权限，拒绝访问");
        errorMap.put(code_404, "找不到资源");
        errorMap.put(code_460, "登录的用户未绑定，一般为第三方账户未与本地账号有绑定关系");
        errorMap.put(code_500, "服务端错误");
        errorMap.put(code_600, "接口请求正常，但是有来自接口的业务提示");
    }
}
